/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package azhar.persistance;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Al-Insan
 */
@Entity
@Table(name = "jenjang")
@NamedQueries({
    @NamedQuery(name = "Jenjang.findAll", query = "SELECT j FROM Jenjang j"),
    @NamedQuery(name = "Jenjang.findByCodeJenjang", query = "SELECT j FROM Jenjang j WHERE j.codeJenjang = :codeJenjang"),
    @NamedQuery(name = "Jenjang.findByNamaJenjang", query = "SELECT j FROM Jenjang j WHERE j.namaJenjang = :namaJenjang")})
public class Jenjang implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "code_jenjang")
    private Integer codeJenjang;
    @Basic(optional = false)
    @Column(name = "nama_jenjang")
    private String namaJenjang;

    public Jenjang() {
    }

    public Jenjang(Integer codeJenjang) {
        this.codeJenjang = codeJenjang;
    }

    public Jenjang(Integer codeJenjang, String namaJenjang) {
        this.codeJenjang = codeJenjang;
        this.namaJenjang = namaJenjang;
    }

    public Integer getCodeJenjang() {
        return codeJenjang;
    }

    public void setCodeJenjang(Integer codeJenjang) {
        this.codeJenjang = codeJenjang;
    }

    public String getNamaJenjang() {
        return namaJenjang;
    }

    public void setNamaJenjang(String namaJenjang) {
        this.namaJenjang = namaJenjang;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codeJenjang != null ? codeJenjang.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Jenjang)) {
            return false;
        }
        Jenjang other = (Jenjang) object;
        if ((this.codeJenjang == null && other.codeJenjang != null) || (this.codeJenjang != null && !this.codeJenjang.equals(other.codeJenjang))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "azhar.persistance.Jenjang[codeJenjang=" + codeJenjang + "]";
    }

}
